package com.example.auth.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;

import java.time.LocalDateTime;


/**
 * sys-log
 *
 * @author cuihaida
 */
@Data
public class SysLog {

    /**
     * the log id
     */
    private Long id;

    /**
     * the log type
     */
    private Integer type;

    /**
     * the log title
     */
    private String title;

    /**
     * the log mapping
     */
    private String mapping;

    /**
     * the log mode
     */
    private String mode;

    /**
     * the method name
     */
    private String method;

    /**
     * the params of method
     */
    private String params;

    /**
     * the result of method
     */
    private String result;

    /**
     * the exception to method
     */
    private String exception;

    /**
     * the start time of method execution
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime startTime;

    /**
     * the end time of method execution
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime endTime;

    /**
     * the request ip
     */
    private String remoteIp;

    /**
     * the request region
     */
    private String remoteRegion;

    /**
     * the creator of log
     */
    private Long createBy;

    /**
      the creation time of log
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime createTime;
}
